package sz.szsmk.citizencard.ui.adapter;


import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;


import java.util.ArrayList;
import java.util.List;

import sz.szsmk.citizencard.R;

public class DeviceAdapter extends BaseAdapter {

    private Context context;

    public DeviceAdapter(Context context) {
        this.context = context;
    }



    @Override
    public int getCount() {
        return 0;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }


    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder;
        if (convertView != null) {
            holder = (ViewHolder) convertView.getTag();
        } else {
            convertView = View.inflate(context, R.layout.battery_item, null);
            holder = new ViewHolder();
            convertView.setTag(holder);
            holder.deviceName = ((TextView) convertView
                    .findViewById(R.id.textview_device_name));
//			viewHolder.deviceRssi = ((TextView) convertView
//					.findViewById(R.id.textview_device_rssi));
            holder.deviceAddress = ((TextView) convertView
                    .findViewById(R.id.textview_device_address));

        }








        return convertView;
    }
    private String reverseMacAddress(String address) {
        String[] a = address.split(":");
        String abc = "";
        for (int i = a.length - 1; i >= 0; i--) {
            abc += a[i];
        }
        return abc;
    }
    class ViewHolder {
        TextView deviceName;
        //		TextView deviceRssi;
        TextView deviceAddress;
    }

    public interface OnDeviceClickListener {
    }

    private OnDeviceClickListener mListener;

    public void setOnDeviceClickListener(OnDeviceClickListener listener) {
        this.mListener = listener;
    }

}
